package JavaSE.CODE.javaNet;

import java.net.InetAddress;
import java.net.InetSocketAddress;

public class InetSocketAddressDemo {
    public static void main(String[] args) {
        InetSocketAddress inetSocketAddress = new InetSocketAddress("127.0.0.1",8080);
        //自动把传入的地址构造成InetAddress对象
        inetSocketAddress.getAddress();//返回整体
        inetSocketAddress.getHostName();//返回IP
        inetSocketAddress.getPort();//返回端口


    }
}
